﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="MyBaseView<object>" %>

<asp:Content ID="registerTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Dynamic Urls
</asp:Content>

<asp:Content ID="registerContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Type-Safe Dynamic Url with jQuery Ajax Wrapper Example (Best)</h2>
    <script type="text/javascript" src="<%=ResolveUrl("~/scripts/DynamicUrls.js") %>"></script>
    <div id="shirtParams">
    <p>
        Style: <select name="style" id="style">
                            <option value="0">V-Neck</option> 
                            <option value="1">Crew</option> 
                 </select> 
    </p>
    <p>
        Color: <select name="color" id="color"> 
                           <option value="0">Red</option> 
                           <option value="1">Green</option> 
                           <option value="2">Yellow</option> 
                 </select> 
    </p>
    </div>
    <div id="preview"></div>
    <script type="text/javascript">
        $('#color').add('#style').change(function(){
            var style = $('#style').val();
            var color = $('#color').val();
            <%= this.JsLoadElement<ShirtController, ShirtColorsEnum, ShirtStylesEnum>((c, color, style) => c.CloseUp(color, style), 
                 new JsLoadOptions{
                       JsTargetSelector = "$('#preview')",
                       InsertionMode = JsLoadInsertionMode.Replace
                })%>
        }).change();
    </script>
</asp:Content>
